<% include ../common/top %>

<div id="page-container" class="container">
  <div class="well head-title">
    <h1>欢迎来到 CODE-SKY</h1>
  </div>
  <div class="clearfix">
      <div class="article-list col-xs-12 col-sm-10">
          <% if(articleList.length){ %>
            <ul class="list-group">
              <% articleList.forEach(function(item){%>
                <li class="article-item list-group-item" id='<%= item._id %>'>
                  <a href='/blog/<%= item._id %>'>
                      <div class="panel panel-default" style="margin-bottom: 0;">
                        <div class="panel-body clearfix">
                          <div class="article-img pull-left">
                              <img src='<%= item.coverImg %>' alt="">
                          </div>
                          <div class="article-content"">
                              <div class="panel-title"><%= item.title %></div>                          
                              <div class="sub-title"><%- item.subTitle %></div>
                              <div class="icon">
                                <span>
                                  <i class="glyphicon glyphicon-time"></i>
                                  <%- item.time %>
                                </span>
                                <span>
                                  <i class="glyphicon glyphicon-th-list"></i>
                                  <%- item.classify %>
                                </span>
                                <span>
                                  <i class="glyphicon glyphicon-tags"></i>
                                  <%- item.tag %>
                                </span>
                              </div>
                          </div>
                        </div>
                      </div>
                  </a>
                </li>
              <% }) %>
            </ul>
          <% } else { %>
            <h1 class="text-center text-danger" style="height:250px;">很遗憾，暂无博文数据...</h1>
            <h4 class="text-center"><a>快去后台编写博客吧...</a></h4>
          <% } %>
       </div>
       <div class="side-bar tag-list col-xs-0 col-sm-2">
         标签分类
       </div>
  </div>
</div>
<hr/>

<% include ../common/footer %>
<% include ../common/bottom %>
<script>
  $('.list-group-item').click(function() {
    var id = $(this).attr('id');
    
  })
</script>
